#Bossbar
execute store result bossbar vs:blue_stream_barrier_hp value run data get entity @n[tag=StreamBarrierSpawner,type=marker,tag=blue] data.Health
execute store result bossbar vs:red_stream_barrier_hp value run data get entity @n[tag=StreamBarrierSpawner,type=marker,tag=red] data.Health
bossbar set vs:blue_stream_barrier_hp name [{"text": "暗流屏障发生器","color": "#0063aa"},{"text": " ❤: ","color": "green","extra": [{"nbt": "data.Health","entity": "@n[tag=StreamBarrierSpawner,type=marker,tag=blue]"}]},{"text": " ⚡: ","color": "yellow","extra": [{"score": {"name": "@n[tag=StreamBarrierSpawner,type=marker,tag=blue]","objective": "Power"}}]}]
bossbar set vs:red_stream_barrier_hp name [{"text": "暗流屏障发生器","color": "#0063aa"},{"text": " ❤: ","color": "green","extra": [{"nbt": "data.Health","entity": "@n[tag=StreamBarrierSpawner,type=marker,tag=red]"}]},{"text": " ⚡: ","color": "yellow","extra": [{"score": {"name": "@n[tag=StreamBarrierSpawner,type=marker,tag=red]","objective": "Power"}}]}]

#win Anim
execute if score #win anim_timer matches -2147483648..2147483647 run function vs:system/game/win_anim/anim

#BarrierSpawner
execute unless entity @e[tag=red,tag=StreamBarrierSpawner,type=marker] unless data storage vs:system temp.game if score game_run system matches 1 run function vs:system/game/_trigger_blue_win
execute unless entity @e[tag=blue,tag=StreamBarrierSpawner,type=marker] unless data storage vs:system temp.game if score game_run system matches 1 run function vs:system/game/_trigger_red_win

execute if score game_run system matches 1 if score devour_coming system matches 0.. run scoreboard players remove devour_coming system 1

#reset_load
function vs:system/game/reset_load/tick
execute if score startCountDown system matches -2147483648..2147483647 run function vs:system/game/start_countdown/countdown

#剩余时间
execute if score game_run system matches 1 if score devour_coming system matches 0.. store result bossbar devour_coming value run scoreboard players get devour_coming_seconds TimeToTick
execute if score game_run system matches 1 if score devour_coming system matches 0.. run bossbar set devour_coming name [{"text":"建议返航时间:","bold":true,"color":"yellow"}," ",{"score": {"name": "devour_coming_seconds","objective": "TimeToTick"}}]

#AutoOver
execute if score game_run system matches 1 unless data storage vs:system temporarySettings{dontAutoOver:true} if function vs:system/game/test/auto_stop_game run function vs:system/game/over

#event
execute if score game_run system matches 1 if score devour_coming system matches 24000 run function vs:system/game/event/10min
execute if score game_run system matches 1 if score devour_coming system matches 12000 run function vs:system/game/event/20min
execute if score game_run system matches 1 if score devour_coming system matches 0 run function vs:system/game/event/30min